<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../../js/vue.js"></script>
</head>
<body>
    <div id="app">
        <h1>今天天气很{{info}}</h1>
        <button @click="change">切换</button>
    </div>
</body>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                msg: 'hello world',
                isHot:true
            },
            computed:{
                info(){
                    return this.isHot?'热':'冷';
                }
            },
            methods: {
                change(){
                    this.isHot=!this.isHot;
                }
            },
        })
    </script>
</html>